package com.drug.mingkang.service.impl;

import com.drug.mingkang.model.Record;
import com.drug.mingkang.mapper.RecordMapper;
import com.drug.mingkang.service.RecordService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * (Record)表服务实现类
 *
 * @author ll
 * @since 2020-08-30 21:45:21
 */
@Service("recordService")
public class RecordServiceImpl implements RecordService {
    @Resource
    private RecordMapper recordMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param
     * @return 实例对象
     */
    @Override
    public Record queryById(String  informId) {
        return this.recordMapper.queryById(informId);
    }

    /**
     * 查询多条数据
     * @return 对象列表
     */
    @Override
    public List<Record> queryAllByLimit(Record record, String userName) {

        System.out.println("============绿林吃屎================="+userName);
        return this.recordMapper.queryAllByLimit(record , userName);
    }

    /**
     * 新增数据
     *
     * @param record 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(Record record) {
        int rows =  this.recordMapper.insert(record);
        return rows;
    }

    /**
     * 修改数据
     *
     * @param record 实例对象
     * @return 实例对象
     */
    @Override
    public Record update(Record record) {
         this.recordMapper.update(record);
         return record;
    }

    /**
     * 通过主键删除数据
     *
     * @param
     * @return 是否成功
     */
    @Override
    public int deleteById(String recordId) {
        int rows =  this.recordMapper.deleteById(recordId);
        return rows;
    }

}